<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('users', function (Blueprint $table) {
            $table->id()->comment('用户自增 ID');
            $table->string('avatar_url', 100)->default('')->comment('头像');
            $table->string('name', 50)->default('')->comment('用户姓名');
            $table->bigInteger('phone')->unique()->comment('用户手机号');
            $table->string('password', 50)->default('')->comment('用户密码');
            $table->string('openid')->unique()->comment('用户唯一标识');
            $table->string('session_key')->default('')->comment('会话密钥');
            $table->string('unionid')->default('')->comment('用户在开放平台的唯一标识');
            $table->rememberToken()->comment('记住登录状态的令牌');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('users');
    }
};
